# 获取教程、习题、案例，共同学习、讨论、打卡
# 请关注：Crossin的编程教室
# 学习交流群：【微信】sunset24678（添加时备注：python）【QQ】群号见 https://python666.cn/c/9

info = {'years': 2.5, 'likes': '🏀'}
print(info)

# 列表通讯录
phones_list = [
    ['小白', 13313313133],
    ['小黑子', 18988988899], 
    ['🐔哥', 13913913139],
    ['老师', 13001313013]
]

for i in phones_list:
    if i[0] == '小白':
        print(i[1])

# 字典通讯录
phones_dict = {
    '小白': 13313313133,
    '小黑子': 18988988899, 
    '🐔哥': 13913913139,
    '老师': 13001313013
}
print(phones_dict['小白'])

# 有重复键
phones_dict = {
    '小白': 13313313133,
    '小黑子': 18988988899, 
    '🐔哥': 13913913139,
    '老师': 13001313013,
    '小白': 13713717137
}
print(phones_dict['小白'])
print(phones_dict)

# 创建
my_dict = dict(years=2.5, likes='🏀')
print(my_dict)

my_dict = {}
print(my_dict)

my_dict = dict()
print(my_dict)

# 获取
my_dict = {'years': 2.5, 'likes': '🏀'}
print(my_dict['likes'])

x_dict = {0: 'aa', 1: 'bb', 2:'cc'}
print(x_dict[1])

print(my_dict.get('hair'))

print(my_dict.get('hair', 'gray'))

# 添加
my_dict['hair'] = 'gray'
print(my_dict)

# 修改
my_dict['likes'] = '🎤'
print(my_dict)

# 删除
my_dict = {'years': 2.5, 'likes': '🏀'}
del my_dict['likes']
print(my_dict)

my_dict = {'years': 2.5, 'likes': '🏀'}
my_dict.pop('likes')
print(my_dict)

my_dict = {'years': 2.5, 'likes': '🏀'}
x = my_dict.pop('likes')
print(x)

x = my_dict.pop('meme', '你干嘛~')
print(x)

# 1键对2值
phones_dict = {
    '小白': [13313313133, 13713717137],
    '小黑子': 18988988899, 
    '🐔哥': 13913913139,
    '老师': 13001313013,
}
name = input()
print(phones_dict[name])






